package com.pearadmin.pro.modules.training.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pearadmin.pro.common.web.base.page.PageResponse;
import com.pearadmin.pro.common.web.base.page.Pageable;
import com.pearadmin.pro.modules.training.entity.TrainingApply;
import com.pearadmin.pro.modules.training.entity.vo.PageTrainingApplyVO;
import com.pearadmin.pro.modules.training.mapper.TrainingApplyMapper;
import com.pearadmin.pro.modules.training.service.TrainingApplyService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 实训申请 service实现类
 * @author ZhouXingYun
 * @date 2022-06-27 10:37:37
 * @version 1.0.0
 */
@Service
public class TrainingApplyServiceImpl  extends ServiceImpl<TrainingApplyMapper, TrainingApply> implements TrainingApplyService {

    @Resource
    private TrainingApplyMapper trainingApplyMapper;

    @Override
    public PageResponse<TrainingApply> page(PageTrainingApplyVO request) {
        return Pageable.of(request,(()-> trainingApplyMapper.selectByEntity(request)));
    }

    @Override
    public List<TrainingApply> selectByEntity(PageTrainingApplyVO trainingApply) {
        return trainingApplyMapper.selectByEntity(trainingApply);
    }
}
